package com.cy5;

import java.util.TreeSet;

public class TreeSetDemo02 {
    public static void main(String[] args) {
        TreeSet<Student> ts = new TreeSet<>();
        ts.add(new Student("diaochan", 25));
        ts.add(new Student("xishi", 28));
        ts.add(new Student("yangyuhuan", 30));
        ts.add(new Student("wangzhaojun", 26));
        ts.add(new Student("yuanxiang", 26));

        for (Student t : ts) {
            System.out.println(t);
        }


    }
}
